#pragma once

#include "Frame.hxx"

class FrameConvertStep;
class FrameArray;
class PipeLine;
class ProcessStep;
class YUVFrameConverter;
class FramePool;

class ProcessStream
{
public:
	ProcessStream(void);
	~ProcessStream(void);

	void initialize();
	void release();

	void start();
	void stop();

	void execute();

	void addFrame( char* raw );
	
	inline void setPipeLine( PipeLine* pipeline ) { _pipeLine = pipeline; }
	inline PipeLine* getPipeLine() { return _pipeLine; }

	inline FrameArray* getFrameArray() { return _frameArray; }

	inline bool isStopped() { return _isStopped; }
	
	inline int getStreamId() { return _streamId; }
	inline void setStreamId( int id ) { _streamId = id; }	

private:
	ProcessStep*	_steps[ PROCESS_STEP_COUNT ];
	FrameArray*	_frameArray;

	FramePool* _pool;

	int	_nextFrameIndex;

	PipeLine* _pipeLine;

	
	bool _isStopped;

	
	int _streamId;

	
	YUVFrameConverter* _frameConverter;

	HANDLE _hStreamThread;
};

